Skip to content

Release/v2.0.0#4

Merged
otapiero merged 7 commits intomainfrom
release/v2.0.0
Mar 8, 2026
Merged

Release/v2.0.0#4
otapiero merged 7 commits intomainfrom
release/v2.0.0

Conversation

@otapiero
Copy link
Copy Markdown
Collaborator

@otapiero otapiero commented Mar 8, 2026

Refactor the codebase by removing unused aliases and enhancing documentation. Update response status codes for missing headers to 400 and improve error logging. Add validation tests for context propagation and update the package version to 2.0.0.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR prepares the v2.0.0 release of TypedRequestContext by removing legacy aliases, refining middleware behavior (notably status codes and logging), improving mapping performance, and expanding documentation and tests around validation/propagation.

Changes:

  • Update missing/invalid required header failures to return 400 (instead of 403), and adjust unit/integration tests accordingly.
  • Improve request-context mapping/perf by compiling property setters and reusing conversion logic in propagation deserialization.
  • Enhance propagation and validation coverage (new propagation validation tests) and update packages/docs/versioning for 2.0.0.

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/TypedRequestContext.UnitTests/RequestContextCoreTests.cs Updates expected status code for missing required header to 400.
tests/TypedRequestContext.Propagation.UnitTests/PropagationTests.cs Adds propagation validation tests; adds infra import for validation exception types.
tests/TypedRequestContext.AspNetCore.IntegrationTests/RequestContextMiddlewareIntegrationTests.cs Updates integration expectation for missing required header to 400/BadRequest.
src/TypedRequestContext/TypedRequestContext.csproj Bumps core package version to 2.0.0.
src/TypedRequestContext/Middleware/RequestContextServiceCollectionExtensions.cs Removes backward-compat aliases; switches to TryAddSingleton; doc reference fixes.
src/TypedRequestContext/Middleware/RequestContextMiddleware.cs Improves error handling/logging when response has already started; updates alias mention in exception message.
src/TypedRequestContext/Infrastructure/PropertyMapper.cs Compiles setters for faster mapping; changes header failures to 400; updates comments.
src/TypedRequestContext.Propagation/TypedRequestContext.Propagation.csproj Bumps propagation package version to 2.0.0; adjusts Microsoft.Extensions.* package versions.
src/TypedRequestContext.Propagation/Infrastructure/PropagationHeadersProvider.cs Adds serializer caching + singleton/scoped resolution strategy (but contains a scope-lifetime bug).
src/TypedRequestContext.Propagation/Infrastructure/AttributeBasedRequestContextDeserializer.cs Reuses core conversion + compiled setters for propagation deserialization.
README.md Updates docs for validation, non-HTTP flows, and revised status codes; expands examples.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@otapiero otapiero merged commit 795f59b into main Mar 8, 2026
1 check passed
@otapiero otapiero deleted the release/v2.0.0 branch March 8, 2026 15:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants